package com.upcode.weighing.exception;

import com.upcode.weighing.common.enums.HttpStatus;

/**
 * 机构信息处理异常
 */
public class SysOrgException extends RuntimeException {

    private int code;

    private String message;

    private Object data;

    public SysOrgException(String message) {
        super(message);
        this.code = 400;
        this.message = message;
    }

    public SysOrgException(HttpStatus status, Object data) {
        super(status.msg());
        this.code = status.value();
        this.message = status.msg();
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public Object getData() {
        return data;
    }
}
